<?php
/*
 * Created on 2011-1-15
 * by lixilei
 */

class DispatchCtrl extends spController{
	
	/**
	 * 转到个人主页
	 */
	public function toHome(){
		if(!empty($_SESSION["userInfo"])){
			$this->results = $_SESSION;
		}
		// 记录并调度信息
		$toURL = "home.htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toHome");
		$this->display($toURL);
	}
	
	/**
	 * 转到注册页
	 */
	public function toRegister(){
		if(!empty($_SESSION["userInfo"])){
			$this->toHome();
		}
		// 记录并调度信息
		$toURL = "register.htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toRegister");
		$this->display($toURL);
	}
	
	/**
	 * 转到反馈页
	 */
	public function toFeedback(){
		if(!empty($_SESSION["userInfo"])){
			$this->results = $_SESSION;
		}
		// 记录并调度信息
		$toURL = "feedback.htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toFeedback");
		$this->display($toURL);
	}
	
	/**
	 * 转到信息发布页
	 */
	public function toCheckIn(){
		if(!empty($_SESSION["userInfo"])){
			$this->results = $_SESSION;
		}
		// 记录并调度信息
		$toURL = "checkIn.htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toCheckIn", $_SESSION["userInfo"]["user_id"]);
		$this->display($toURL);
	}
	
	/**
	 * 转到同步设置页
	 */
	public function toConnectionList(){
		if(!empty($_SESSION["userInfo"])){
			$this->results = $_SESSION;
		}
		// 记录并调度信息
		$toURL = "connection-list.htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toConnectionList", $_SESSION["userInfo"]["user_id"]);
		$this->display($toURL);
	}
	
	/**
	 * 转到相应平台的同步页面
	 */
	public function toConnect(){
		$web = $_REQUEST["web"];
		if(!empty($_SESSION["userInfo"])){
			$this->results = $_SESSION;
		}
		// 记录并调度信息
		$toURL = "connect-".$web.".htm";
		$dispatchBiz = spClass("DispatchBiz", null, BIZ_PATH."DispatchBiz.php");
		$dispatchBiz->recordDispatch($toURL, "DispatchCtrl&toConnect&".$web, $_SESSION["userInfo"]["user_id"]);
		$this->display($toURL);
	}
}
?>
